<?php

declare(strict_types=1);
/**
 * FastApp.
 * 9/22/24
 * @Author deepsea159
 * @Contact telegram:deepsea159
 */

namespace App\Fastapp\Api\Controller\Account;


use App\Fastapp\Api\Controller\ApiController;
use App\Fastapp\Api\Service\Account\MessageService;
use App\Fastapp\Aspect\ApiAuth;
use Hyperf\Di\Annotation\Inject;
use Hyperf\HttpServer\Annotation\Controller;
use Hyperf\HttpServer\Annotation\GetMapping;
use Psr\Http\Message\ResponseInterface;

#[Controller(prefix: "api/message"), ApiAuth]
class MessageController extends ApiController
{
    #[Inject]
    public MessageService $service;

    #[GetMapping('list')]
    public function list(): ResponseInterface
    {
        return $this->success($this->service->list($this->request->all()));
    }

    #[GetMapping('last')]
    public function last(): ResponseInterface
    {
        return $this->success($this->service->last());
    }
}